<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">

<title>class DEBUGGER__::UI_ServerBase - debug: Ruby Standard Library Documentation</title>


<script src="../js/navigation.js" defer></script>
<script src="../js/search.js" defer></script>
<script src="../js/search_index.js" defer></script>
<script src="../js/searcher.js" defer></script>
<script src="../js/darkfish.js" defer></script>

<script src="../js/jquery-3.2.0.min.js"></script>

<script src="../js/vue.min.js"></script>
<script src="../js/js.cookie.min.js"></script>

<link href="../css/fonts.css" rel="stylesheet">
<link id='rdoccss' href="../css/rdoc.css" rel="stylesheet">
<link href="../css/carbon17.css" rel="stylesheet">

<script type="text/javascript">
  var rdoc_rel_prefix = "../";
  var index_rel_prefix = "../";
  var darkModeCsseHref = "../css/rdoc-dm.css"
  var defaultModeCssHref = "../css/rdoc.css"
  // var cssDarkmode = Cookies.get('darkmode');
  
  if( Cookies.get("darkmode") == "true") {
	$('#rdoccss').attr("href", darkModeCsseHref);
}

//  https://cssdeck.com/blog/simple-jquery-stylesheet-switcher/

document.write('<style type="text/css">body{display:none}</style>');

</script>


</head>
<body id="top" role="document" class="class">
  <!-- this is class.html -->

  <div id='actionbar' >
    <div class='wrapper mdiv'>
      <ul class='grids g0'></ul>
    </div> 
    <!-- VERSION HEADER for 3.3.0.preview2 NOT FOUND -->
  </div> <!-- end action bar -->

  <div class='wrapper hdiv'>

    


    <nav id='vapp' role="navigation">
    <div id="project-navigation">
      <div id="home-section" role="region" title="Quick navigation" class="nav-section">
  <h2><a href="../index.html" rel="home">Home</a></h2>

  <div id="table-of-contents-navigation"  >
    <a href="../table_of_contents.html#pages">Pages</a>
    <a href="../table_of_contents.html#classes">Classes</a>
    <a href="../table_of_contents.html#methods">Methods</a>
  </div>
</div>

      <div id="search-section" role="search" class="project-section initially-hidden">
  <form action="#" method="get" accept-charset="utf-8">
    <div id="search-field-wrapper">
      <input id="search-field" role="combobox" aria-label="Search"
             aria-autocomplete="list" aria-controls="search-results"
             type="text" name="search" placeholder="Search" spellcheck="false"
             title="Type to search, Up and Down to navigate, Enter to load">
    </div>

    <ul id="search-results" aria-label="Search Results"
        aria-busy="false" aria-expanded="false"
        aria-atomic="false" class="initially-hidden"></ul>
  </form>
</div>

    </div>


    

    <button id='toggleThing' @click="toggleNav()" >Show/hide navigation</button>
    <div :class="isOpen ? 'block' : 'hidden' " id='toggleMe'>
      <div id="class-metadata">
        
        
<div id="parent-class-section" class="nav-section">
  <h3>Parent</h3>

  <p class="link">UI_Base
</div>

        
        
        
<!-- Method Quickref -->
<div id="method-list-section" class="nav-section">
  <h3>Methods</h3>

  <ul class="link-list" role="directory">
    <li ><a href="#method-c-new">::new</a>
    <li ><a href="#method-i-accept">#accept</a>
    <li ><a href="#method-i-activate">#activate</a>
    <li ><a href="#method-i-after_fork_parent">#after_fork_parent</a>
    <li ><a href="#method-i-ask">#ask</a>
    <li ><a href="#method-i-check_cookie">#check_cookie</a>
    <li ><a href="#method-i-cleanup_reader">#cleanup_reader</a>
    <li ><a href="#method-i-deactivate">#deactivate</a>
    <li ><a href="#method-i-greeting">#greeting</a>
    <li ><a href="#method-i-parse_option">#parse_option</a>
    <li ><a href="#method-i-pause">#pause</a>
    <li ><a href="#method-i-process">#process</a>
    <li ><a href="#method-i-puts">#puts</a>
    <li ><a href="#method-i-quit">#quit</a>
    <li ><a href="#method-i-readline">#readline</a>
    <li ><a href="#method-i-remote-3F">#remote?</a>
    <li ><a href="#method-i-setup_interrupt">#setup_interrupt</a>
    <li ><a href="#method-i-sigurg_overridden-3F">#sigurg_overridden?</a>
    <li ><a href="#method-i-sock">#sock</a>
    <li ><a href="#method-i-vscode_setup">#vscode_setup</a>
    <li ><a href="#method-i-width">#width</a>
  </ul>
</div>

      </div>
     </div>
    </nav>


    <div id='extraz'><div class='adzbox-index'  >
      
     </div>         
    </div>

    <main role="main" aria-labelledby="class-DEBUGGER__::UI_ServerBase">
    <h1 id="class-DEBUGGER__::UI_ServerBase" class="class">
      class DEBUGGER__::UI_ServerBase
    </h1>

    <section class="description">
    
    </section>

      <section id="5Buntitled-5D" class="documentation-section">


      <section class="constants-list">
      <header>
      <h3>Constants</h3>
      </header>
      <dl>
          <dt id="TRAP_SIGNAL">TRAP_SIGNAL
          <dd><p>maybe Windows?</p>
        </dl>
        </section>

        <section class="attribute-method-details" class="method-section">
        <header>
        <h3>Attributes</h3>
        </header>

          <div id="attribute-i-reader_thread" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">reader_thread</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              
              </div>
            </div>
            </section>


                <section id="public-class-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Class Methods</h3>
                </header>

                  <div id="method-c-new" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">new</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="new-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/server.rb, line 9</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>
  <span class="ruby-ivar">@sock</span> = <span class="ruby-ivar">@sock_for_fork</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@accept_m</span> = <span class="ruby-constant">Mutex</span>.<span class="ruby-identifier">new</span>
  <span class="ruby-ivar">@accept_cv</span> = <span class="ruby-constant">ConditionVariable</span>.<span class="ruby-identifier">new</span>
  <span class="ruby-ivar">@client_addr</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@q_msg</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@q_ans</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@unsent_messages</span> = []
  <span class="ruby-ivar">@width</span> = <span class="ruby-value">80</span>
  <span class="ruby-ivar">@repl</span> = <span class="ruby-keyword">true</span>
  <span class="ruby-ivar">@session</span> = <span class="ruby-keyword">nil</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

                <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Instance Methods</h3>
                </header>

                  <div id="method-i-accept" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">accept</span><span
                                class="method-args">() { |sock_for_fork, already_connected: true| ... }</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="accept-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/server.rb, line 31</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">accept</span>
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@sock_for_fork</span>
    <span class="ruby-keyword">begin</span>
      <span class="ruby-keyword">yield</span> <span class="ruby-ivar">@sock_for_fork</span>, <span class="ruby-value">already_connected:</span> <span class="ruby-keyword">true</span>
    <span class="ruby-keyword">ensure</span>
      <span class="ruby-ivar">@sock_for_fork</span>.<span class="ruby-identifier">close</span>
      <span class="ruby-ivar">@sock_for_fork</span> = <span class="ruby-keyword">nil</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-activate" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">activate</span><span
                                class="method-args">(session, on_fork: false)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="activate-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/server.rb, line 42</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">activate</span> <span class="ruby-identifier">session</span>, <span class="ruby-value">on_fork:</span> <span class="ruby-keyword">false</span>
  <span class="ruby-ivar">@session</span> = <span class="ruby-identifier">session</span>
  <span class="ruby-ivar">@reader_thread</span> = <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword">do</span>
    <span class="ruby-comment"># An error on this thread should break the system.</span>
    <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">current</span>.<span class="ruby-identifier">abort_on_exception</span> = <span class="ruby-keyword">true</span>
    <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">current</span>.<span class="ruby-identifier">name</span> = <span class="ruby-string">&#39;DEBUGGER__::Server::reader&#39;</span>

    <span class="ruby-identifier">accept</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">server</span>, <span class="ruby-value">already_connected:</span> <span class="ruby-keyword">false</span><span class="ruby-operator">|</span>
      <span class="ruby-constant">DEBUGGER__</span>.<span class="ruby-identifier">warn</span> <span class="ruby-string">&quot;Connected.&quot;</span>
      <span class="ruby-identifier">greeting_done</span> = <span class="ruby-keyword">false</span>
      <span class="ruby-ivar">@need_pause_at_first</span> = <span class="ruby-keyword">true</span>

      <span class="ruby-ivar">@accept_m</span>.<span class="ruby-identifier">synchronize</span>{
        <span class="ruby-ivar">@sock</span> = <span class="ruby-identifier">server</span>
        <span class="ruby-identifier">greeting</span>
        <span class="ruby-identifier">greeting_done</span> = <span class="ruby-keyword">true</span>

        <span class="ruby-ivar">@accept_cv</span>.<span class="ruby-identifier">signal</span>

        <span class="ruby-comment"># flush unsent messages</span>
        <span class="ruby-ivar">@unsent_messages</span>.<span class="ruby-identifier">each</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">m</span><span class="ruby-operator">|</span>
          <span class="ruby-ivar">@sock</span>.<span class="ruby-identifier">puts</span> <span class="ruby-identifier">m</span>
        } <span class="ruby-keyword">if</span> <span class="ruby-ivar">@repl</span>
        <span class="ruby-ivar">@unsent_messages</span>.<span class="ruby-identifier">clear</span>

        <span class="ruby-ivar">@q_msg</span> = <span class="ruby-constant">Queue</span>.<span class="ruby-identifier">new</span>
        <span class="ruby-ivar">@q_ans</span> = <span class="ruby-constant">Queue</span>.<span class="ruby-identifier">new</span>
      } <span class="ruby-keyword">unless</span> <span class="ruby-identifier">already_connected</span>

      <span class="ruby-identifier">setup_interrupt</span> <span class="ruby-keyword">do</span>
        <span class="ruby-identifier">pause</span> <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">already_connected</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-ivar">@need_pause_at_first</span>
        <span class="ruby-identifier">process</span>
      <span class="ruby-keyword">end</span>

    <span class="ruby-keyword">rescue</span> <span class="ruby-constant">GreetingError</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">e</span>
      <span class="ruby-constant">DEBUGGER__</span>.<span class="ruby-identifier">warn</span> <span class="ruby-node">&quot;GreetingError: #{e.message}&quot;</span>
      <span class="ruby-keyword">next</span>
    <span class="ruby-keyword">rescue</span> <span class="ruby-constant">Terminate</span>
      <span class="ruby-identifier">raise</span> <span class="ruby-comment"># should catch at outer scope</span>
    <span class="ruby-keyword">rescue</span> <span class="ruby-constant">RetryConnection</span>
      <span class="ruby-keyword">next</span>
    <span class="ruby-keyword">rescue</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">e</span>
      <span class="ruby-constant">DEBUGGER__</span>.<span class="ruby-identifier">warn</span> <span class="ruby-node">&quot;ReaderThreadError: #{e}&quot;</span>
      <span class="ruby-identifier">pp</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">backtrace</span>
    <span class="ruby-keyword">ensure</span>
      <span class="ruby-constant">DEBUGGER__</span>.<span class="ruby-identifier">warn</span> <span class="ruby-string">&quot;Disconnected.&quot;</span>
      <span class="ruby-identifier">cleanup_reader</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">greeting_done</span>
    <span class="ruby-keyword">end</span> <span class="ruby-comment"># accept</span>

  <span class="ruby-keyword">rescue</span> <span class="ruby-constant">Terminate</span>
    <span class="ruby-comment"># ignore</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-after_fork_parent" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">after_fork_parent</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="after_fork_parent-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/server.rb, line 373</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">after_fork_parent</span>
  <span class="ruby-comment"># do nothing</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-ask" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">ask</span><span
                                class="method-args">(prompt)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="ask-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/server.rb, line 309</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">ask</span> <span class="ruby-identifier">prompt</span>
  <span class="ruby-identifier">sock</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">s</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;ask #{Process.pid} #{prompt}&quot;</span>
    <span class="ruby-ivar">@q_ans</span>.<span class="ruby-identifier">pop</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-check_cookie" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">check_cookie</span><span
                                class="method-args">(c)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="check_cookie-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/server.rb, line 105</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">check_cookie</span> <span class="ruby-identifier">c</span>
  <span class="ruby-identifier">cookie</span> = <span class="ruby-constant">CONFIG</span>[<span class="ruby-value">:cookie</span>]
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">cookie</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">cookie</span> <span class="ruby-operator">!=</span> <span class="ruby-identifier">c</span>
    <span class="ruby-identifier">raise</span> <span class="ruby-constant">GreetingError</span>, <span class="ruby-node">&quot;Cookie mismatch (#{$2.inspect} was sent)&quot;</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-cleanup_reader" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">cleanup_reader</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="cleanup_reader-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/server.rb, line 96</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">cleanup_reader</span>
  <span class="ruby-ivar">@sock</span>.<span class="ruby-identifier">close</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@sock</span>
  <span class="ruby-ivar">@sock</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@q_msg</span>.<span class="ruby-identifier">close</span>
  <span class="ruby-ivar">@q_msg</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@q_ans</span>.<span class="ruby-identifier">close</span>
  <span class="ruby-ivar">@q_ans</span> = <span class="ruby-keyword">nil</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-deactivate" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">deactivate</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="deactivate-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/server.rb, line 26</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">deactivate</span>
  <span class="ruby-ivar">@reader_thread</span>.<span class="ruby-identifier">raise</span> <span class="ruby-constant">Terminate</span>
  <span class="ruby-ivar">@reader_thread</span>.<span class="ruby-identifier">join</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-greeting" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">greeting</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="greeting-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/server.rb, line 130</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">greeting</span>
  <span class="ruby-keyword">case</span> <span class="ruby-identifier">g</span> = <span class="ruby-ivar">@sock</span>.<span class="ruby-identifier">gets</span>
  <span class="ruby-keyword">when</span> <span class="ruby-regexp">/^info cookie:\s+(.*)$/</span>
    <span class="ruby-identifier">require</span> <span class="ruby-string">&#39;etc&#39;</span>

    <span class="ruby-identifier">check_cookie</span> <span class="ruby-node">$1</span>
    <span class="ruby-ivar">@sock</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;PID: #{Process.pid}, $0: #{$0}&quot;</span>
    <span class="ruby-ivar">@sock</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;debug #{VERSION} on #{RUBY_DESCRIPTION}&quot;</span>
    <span class="ruby-ivar">@sock</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;uname: #{Etc.uname.inspect}&quot;</span>
    <span class="ruby-ivar">@sock</span>.<span class="ruby-identifier">close</span>
    <span class="ruby-identifier">raise</span> <span class="ruby-constant">GreetingError</span>, <span class="ruby-string">&quot;HEAD request&quot;</span>

  <span class="ruby-keyword">when</span> <span class="ruby-regexp">/^version:\s+(\S+)\s+(.+)$/</span>
    <span class="ruby-identifier">v</span>, <span class="ruby-identifier">params</span> = <span class="ruby-node">$1</span>, <span class="ruby-node">$2</span>

    <span class="ruby-comment"># TODO: protocol version</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">v</span> <span class="ruby-operator">!=</span> <span class="ruby-constant">VERSION</span>
      <span class="ruby-ivar">@sock</span>.<span class="ruby-identifier">puts</span> <span class="ruby-identifier">msg</span> = <span class="ruby-node">&quot;out DEBUGGER: Incompatible version (server:#{VERSION} and client:#{$1})&quot;</span>
      <span class="ruby-identifier">raise</span> <span class="ruby-constant">GreetingError</span>, <span class="ruby-identifier">msg</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-identifier">parse_option</span>(<span class="ruby-identifier">params</span>)

    <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;DEBUGGER (client): Connected. PID:#{Process.pid}, $0:#{$0}&quot;</span>
    <span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;DEBUGGER (client): Type `Ctrl-C` to enter the debug console.&quot;</span> <span class="ruby-keyword">unless</span> <span class="ruby-ivar">@need_pause_at_first</span>
    <span class="ruby-identifier">puts</span>

  <span class="ruby-keyword">when</span> <span class="ruby-regexp">/^Content-Length: (\d+)/</span>
    <span class="ruby-identifier">require_relative</span> <span class="ruby-string">&#39;server_dap&#39;</span>

    <span class="ruby-identifier">raise</span> <span class="ruby-keyword">unless</span> <span class="ruby-ivar">@sock</span>.<span class="ruby-identifier">read</span>(<span class="ruby-value">2</span>) <span class="ruby-operator">==</span> <span class="ruby-string">&quot;\r\n&quot;</span>
    <span class="ruby-keyword">self</span>.<span class="ruby-identifier">extend</span>(<span class="ruby-constant">UI_DAP</span>)
    <span class="ruby-ivar">@repl</span> = <span class="ruby-keyword">false</span>
    <span class="ruby-ivar">@need_pause_at_first</span> = <span class="ruby-keyword">false</span>
    <span class="ruby-identifier">dap_setup</span> <span class="ruby-ivar">@sock</span>.<span class="ruby-identifier">read</span>(<span class="ruby-node">$1</span>.<span class="ruby-identifier">to_i</span>)

  <span class="ruby-keyword">when</span> <span class="ruby-regexp">/^GET\s\/json\sHTTP\/1.1/</span>, <span class="ruby-regexp">/^GET\s\/json\/version\sHTTP\/1.1/</span>, <span class="ruby-regexp">/^GET\s\/\w{8}-\w{4}-\w{4}-\w{4}-\w{12}\sHTTP\/1.1/</span>
    <span class="ruby-comment"># The reason for not using @uuid here is @uuid is nil if users run debugger without `--open=chrome`.</span>

    <span class="ruby-identifier">require_relative</span> <span class="ruby-string">&#39;server_cdp&#39;</span>

    <span class="ruby-keyword">self</span>.<span class="ruby-identifier">extend</span>(<span class="ruby-constant">UI_CDP</span>)
    <span class="ruby-identifier">send_chrome_response</span> <span class="ruby-identifier">g</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">raise</span> <span class="ruby-constant">GreetingError</span>, <span class="ruby-node">&quot;Unknown greeting message: #{g}&quot;</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-parse_option" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">parse_option</span><span
                                class="method-args">(params)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="parse_option-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/server.rb, line 112</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">parse_option</span> <span class="ruby-identifier">params</span>
  <span class="ruby-keyword">case</span> <span class="ruby-identifier">params</span>.<span class="ruby-identifier">strip</span>
  <span class="ruby-keyword">when</span> <span class="ruby-regexp">/width:\s+(\d+)/</span>
    <span class="ruby-ivar">@width</span> = <span class="ruby-node">$1</span>.<span class="ruby-identifier">to_i</span>
    <span class="ruby-identifier">parse_option</span> <span class="ruby-identifier">$~</span>.<span class="ruby-identifier">post_match</span>
  <span class="ruby-keyword">when</span> <span class="ruby-regexp">/cookie:\s+(\S+)/</span>
    <span class="ruby-identifier">check_cookie</span> <span class="ruby-node">$1</span> <span class="ruby-keyword">if</span> <span class="ruby-node">$1</span> <span class="ruby-operator">!=</span> <span class="ruby-string">&#39;-&#39;</span>
    <span class="ruby-identifier">parse_option</span> <span class="ruby-identifier">$~</span>.<span class="ruby-identifier">post_match</span>
  <span class="ruby-keyword">when</span> <span class="ruby-regexp">/nonstop: (true|false)/</span>
    <span class="ruby-ivar">@need_pause_at_first</span> = <span class="ruby-keyword">false</span> <span class="ruby-keyword">if</span> <span class="ruby-node">$1</span> <span class="ruby-operator">==</span> <span class="ruby-string">&#39;true&#39;</span>
    <span class="ruby-identifier">parse_option</span> <span class="ruby-identifier">$~</span>.<span class="ruby-identifier">post_match</span>
  <span class="ruby-keyword">when</span> <span class="ruby-regexp">/(.+):(.+)/</span>
    <span class="ruby-identifier">raise</span> <span class="ruby-constant">GreetingError</span>, <span class="ruby-node">&quot;Unkown option: #{params}&quot;</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-comment"># OK</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-pause" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">pause</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="pause-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/server.rb, line 361</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">pause</span>
  <span class="ruby-comment"># $stderr.puts &quot;DEBUG: pause request&quot;</span>
  <span class="ruby-constant">Process</span>.<span class="ruby-identifier">kill</span>(<span class="ruby-constant">TRAP_SIGNAL</span>, <span class="ruby-constant">Process</span>.<span class="ruby-identifier">pid</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-process" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">process</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="process-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/server.rb, line 177</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">process</span>
  <span class="ruby-keyword">while</span> <span class="ruby-keyword">true</span>
    <span class="ruby-constant">DEBUGGER__</span>.<span class="ruby-identifier">debug</span>{ <span class="ruby-string">&quot;sleep IO.select&quot;</span> }
    <span class="ruby-identifier">_r</span> = <span class="ruby-constant">IO</span>.<span class="ruby-identifier">select</span>([<span class="ruby-ivar">@sock</span>])
    <span class="ruby-constant">DEBUGGER__</span>.<span class="ruby-identifier">debug</span>{ <span class="ruby-string">&quot;wakeup IO.select&quot;</span> }

    <span class="ruby-identifier">line</span> = <span class="ruby-ivar">@session</span>.<span class="ruby-identifier">process_group</span>.<span class="ruby-identifier">sync</span> <span class="ruby-keyword">do</span>
      <span class="ruby-keyword">unless</span> <span class="ruby-constant">IO</span>.<span class="ruby-identifier">select</span>([<span class="ruby-ivar">@sock</span>], <span class="ruby-keyword">nil</span>, <span class="ruby-keyword">nil</span>, <span class="ruby-value">0</span>)
        <span class="ruby-constant">DEBUGGER__</span>.<span class="ruby-identifier">debug</span>{ <span class="ruby-string">&quot;UI_Server can not read&quot;</span> }
        <span class="ruby-keyword">break</span> <span class="ruby-value">:can_not_read</span>
      <span class="ruby-keyword">end</span>
      <span class="ruby-ivar">@sock</span>.<span class="ruby-identifier">gets</span>&amp;.<span class="ruby-identifier">chomp</span>.<span class="ruby-identifier">tap</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">line</span><span class="ruby-operator">|</span>
        <span class="ruby-constant">DEBUGGER__</span>.<span class="ruby-identifier">debug</span>{ <span class="ruby-node">&quot;UI_Server received: #{line}&quot;</span> }
      }
    <span class="ruby-keyword">end</span>

    <span class="ruby-keyword">return</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">line</span>
    <span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">line</span> <span class="ruby-operator">==</span> <span class="ruby-value">:can_not_read</span>

    <span class="ruby-keyword">case</span> <span class="ruby-identifier">line</span>
    <span class="ruby-keyword">when</span> <span class="ruby-regexp">/\Apause/</span>
      <span class="ruby-identifier">pause</span>
    <span class="ruby-keyword">when</span> <span class="ruby-regexp">/\Acommand (\d+) (\d+) ?(.+)/</span>
      <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;not in subsession, but received: #{line.inspect}&quot;</span> <span class="ruby-keyword">unless</span> <span class="ruby-ivar">@session</span>.<span class="ruby-identifier">in_subsession?</span>

      <span class="ruby-keyword">if</span> <span class="ruby-node">$1</span>.<span class="ruby-identifier">to_i</span> <span class="ruby-operator">==</span> <span class="ruby-constant">Process</span>.<span class="ruby-identifier">pid</span>
        <span class="ruby-ivar">@width</span> = <span class="ruby-node">$2</span>.<span class="ruby-identifier">to_i</span>
        <span class="ruby-ivar">@q_msg</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">$3</span>
      <span class="ruby-keyword">else</span>
        <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;pid:#{Process.pid} but get #{line}&quot;</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">when</span> <span class="ruby-regexp">/\Aanswer (\d+) (.*)/</span>
      <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;not in subsession, but received: #{line.inspect}&quot;</span> <span class="ruby-keyword">unless</span> <span class="ruby-ivar">@session</span>.<span class="ruby-identifier">in_subsession?</span>

      <span class="ruby-keyword">if</span> <span class="ruby-node">$1</span>.<span class="ruby-identifier">to_i</span> <span class="ruby-operator">==</span> <span class="ruby-constant">Process</span>.<span class="ruby-identifier">pid</span>
        <span class="ruby-ivar">@q_ans</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">$2</span>
      <span class="ruby-keyword">else</span>
        <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;pid:#{Process.pid} but get #{line}&quot;</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;unsupported: #{line.inspect}&quot;</span>
      <span class="ruby-identifier">exit!</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-puts" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">puts</span><span
                                class="method-args">(str = nil)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="puts-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/server.rb, line 316</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">puts</span> <span class="ruby-identifier">str</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-keyword">case</span> <span class="ruby-identifier">str</span>
  <span class="ruby-keyword">when</span> <span class="ruby-constant">Array</span>
    <span class="ruby-identifier">enum</span> = <span class="ruby-identifier">str</span>.<span class="ruby-identifier">each</span>
  <span class="ruby-keyword">when</span> <span class="ruby-constant">String</span>
    <span class="ruby-identifier">enum</span> = <span class="ruby-identifier">str</span>.<span class="ruby-identifier">each_line</span>
  <span class="ruby-keyword">when</span> <span class="ruby-keyword">nil</span>
    <span class="ruby-identifier">enum</span> = [<span class="ruby-string">&#39;&#39;</span>].<span class="ruby-identifier">each</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">sock</span> <span class="ruby-value">skip:</span> <span class="ruby-keyword">true</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">enum</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">line</span><span class="ruby-operator">|</span>
      <span class="ruby-identifier">msg</span> = <span class="ruby-node">&quot;out #{line.chomp}&quot;</span>
      <span class="ruby-keyword">if</span> <span class="ruby-identifier">s</span>
        <span class="ruby-identifier">s</span>.<span class="ruby-identifier">puts</span> <span class="ruby-identifier">msg</span>
      <span class="ruby-keyword">else</span>
        <span class="ruby-ivar">@unsent_messages</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">msg</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-quit" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">quit</span><span
                                class="method-args">(n, &amp;_b)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="quit-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/server.rb, line 366</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">quit</span> <span class="ruby-identifier">n</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">_b</span>
  <span class="ruby-comment"># ignore n</span>
  <span class="ruby-identifier">sock</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">s</span>.<span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;quit&quot;</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-readline" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">readline</span><span
                                class="method-args">(prompt)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="readline-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/server.rb, line 338</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">readline</span> <span class="ruby-identifier">prompt</span>
  <span class="ruby-identifier">input</span> = (<span class="ruby-identifier">sock</span>(<span class="ruby-value">skip:</span> <span class="ruby-constant">CONFIG</span>[<span class="ruby-value">:skip_bp</span>]) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">next</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">s</span>

    <span class="ruby-keyword">if</span> <span class="ruby-ivar">@repl</span>
      <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;not in subsession, but received: #{line.inspect}&quot;</span> <span class="ruby-keyword">unless</span> <span class="ruby-ivar">@session</span>.<span class="ruby-identifier">in_subsession?</span>
      <span class="ruby-identifier">line</span> = <span class="ruby-node">&quot;input #{Process.pid}&quot;</span>
      <span class="ruby-constant">DEBUGGER__</span>.<span class="ruby-identifier">debug</span>{ <span class="ruby-node">&quot;send: #{line}&quot;</span> }
      <span class="ruby-identifier">s</span>.<span class="ruby-identifier">puts</span> <span class="ruby-identifier">line</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-identifier">sleep</span> <span class="ruby-value">0.01</span> <span class="ruby-keyword">until</span> <span class="ruby-ivar">@q_msg</span>
    <span class="ruby-ivar">@q_msg</span>.<span class="ruby-identifier">pop</span>.<span class="ruby-identifier">tap</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">msg</span><span class="ruby-operator">|</span>
      <span class="ruby-constant">DEBUGGER__</span>.<span class="ruby-identifier">debug</span>{ <span class="ruby-node">&quot;readline: #{msg.inspect}&quot;</span> }
    }
  <span class="ruby-keyword">end</span> <span class="ruby-operator">||</span> <span class="ruby-string">&#39;continue&#39;</span>)

  <span class="ruby-keyword">if</span> <span class="ruby-identifier">input</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">String</span>)
    <span class="ruby-identifier">input</span>.<span class="ruby-identifier">strip</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">input</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-remote-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">remote?</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="remote-3F-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/server.rb, line 223</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">remote?</span>
  <span class="ruby-keyword">true</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-setup_interrupt" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">setup_interrupt</span><span
                                class="method-args">() { || ... }</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="setup_interrupt-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/server.rb, line 255</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">setup_interrupt</span>
  <span class="ruby-identifier">prev_handler</span> = <span class="ruby-identifier">trap</span>(<span class="ruby-constant">TRAP_SIGNAL</span>) <span class="ruby-keyword">do</span>
    <span class="ruby-comment"># $stderr.puts &quot;trapped SIGINT&quot;</span>
    <span class="ruby-constant">ThreadClient</span>.<span class="ruby-identifier">current</span>.<span class="ruby-identifier">on_trap</span> <span class="ruby-constant">TRAP_SIGNAL</span>

    <span class="ruby-keyword">case</span> <span class="ruby-identifier">prev_handler</span>
    <span class="ruby-keyword">when</span> <span class="ruby-constant">Proc</span>
      <span class="ruby-identifier">prev_handler</span>.<span class="ruby-identifier">call</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-comment"># ignore</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-keyword">if</span> <span class="ruby-identifier">sigurg_overridden?</span>(<span class="ruby-identifier">prev_handler</span>)
    <span class="ruby-constant">DEBUGGER__</span>.<span class="ruby-identifier">warn</span> <span class="ruby-string">&quot;SIGURG handler is overridden by the debugger.&quot;</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">yield</span>
<span class="ruby-keyword">ensure</span>
  <span class="ruby-identifier">trap</span>(<span class="ruby-constant">TRAP_SIGNAL</span>, <span class="ruby-identifier">prev_handler</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-sigurg_overridden-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">sigurg_overridden?</span><span
                                class="method-args">(prev_handler)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="sigurg_overridden-3F-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/server.rb, line 231</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">sigurg_overridden?</span> <span class="ruby-identifier">prev_handler</span>
  <span class="ruby-keyword">case</span> <span class="ruby-identifier">prev_handler</span>
  <span class="ruby-keyword">when</span> <span class="ruby-string">&quot;SYSTEM_DEFAULT&quot;</span>, <span class="ruby-string">&quot;DEFAULT&quot;</span>
    <span class="ruby-keyword">false</span>
  <span class="ruby-keyword">when</span> <span class="ruby-constant">Proc</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">prev_handler</span>.<span class="ruby-identifier">source_location</span>[<span class="ruby-value">0</span>] <span class="ruby-operator">==</span> <span class="ruby-keyword">__FILE__</span>
      <span class="ruby-keyword">false</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-keyword">true</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-keyword">true</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-sock" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">sock</span><span
                                class="method-args">(skip: false) { |nil| ... }</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="sock-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/server.rb, line 280</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">sock</span> <span class="ruby-value">skip:</span> <span class="ruby-keyword">false</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">s</span> = <span class="ruby-ivar">@sock</span>         <span class="ruby-comment"># already connection</span>
    <span class="ruby-comment"># ok</span>
  <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">skip</span> <span class="ruby-operator">==</span> <span class="ruby-keyword">true</span>   <span class="ruby-comment"># skip process</span>
    <span class="ruby-identifier">no_sock</span> = <span class="ruby-keyword">true</span>
    <span class="ruby-identifier">r</span> = <span class="ruby-ivar">@accept_m</span>.<span class="ruby-identifier">synchronize</span> <span class="ruby-keyword">do</span>
      <span class="ruby-keyword">if</span> <span class="ruby-ivar">@sock</span>
        <span class="ruby-identifier">no_sock</span> = <span class="ruby-keyword">false</span>
      <span class="ruby-keyword">else</span>
        <span class="ruby-keyword">yield</span> <span class="ruby-keyword">nil</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">return</span> <span class="ruby-identifier">r</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">no_sock</span>
  <span class="ruby-keyword">else</span>                 <span class="ruby-comment"># wait for connection</span>
    <span class="ruby-keyword">until</span> <span class="ruby-identifier">s</span> = <span class="ruby-ivar">@sock</span>
      <span class="ruby-ivar">@accept_m</span>.<span class="ruby-identifier">synchronize</span>{
        <span class="ruby-keyword">unless</span> <span class="ruby-ivar">@sock</span>
          <span class="ruby-constant">DEBUGGER__</span>.<span class="ruby-identifier">warn</span> <span class="ruby-string">&quot;wait for debugger connection...&quot;</span>
          <span class="ruby-ivar">@accept_cv</span>.<span class="ruby-identifier">wait</span>(<span class="ruby-ivar">@accept_m</span>)
        <span class="ruby-keyword">end</span>
      }
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-keyword">yield</span> <span class="ruby-identifier">s</span>
<span class="ruby-keyword">rescue</span> <span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">EPIPE</span>
  <span class="ruby-comment"># ignore</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-vscode_setup" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">vscode_setup</span><span
                                class="method-args">(debug_port)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="vscode_setup-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/server.rb, line 377</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">vscode_setup</span> <span class="ruby-identifier">debug_port</span>
  <span class="ruby-identifier">require_relative</span> <span class="ruby-string">&#39;server_dap&#39;</span>
  <span class="ruby-constant">UI_DAP</span>.<span class="ruby-identifier">setup</span> <span class="ruby-identifier">debug_port</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-width" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">width</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="width-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/server.rb, line 227</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">width</span>
  <span class="ruby-ivar">@width</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

              </section>
              </main>



            </div>  <!--  class='wrapper hdiv' -->


<footer id="validator-badges" role="contentinfo">
<p><a href="https://validator.w3.org/check/referer">Validate</a></p>
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.4.0.</p>
<p>Based on <a href="https://github.com/ged/darkfish/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.</p>

  
    <p><p><a href="https://ruby-doc.org">Ruby-doc.org</a> is provided by <a href="https://jamesbritt.com">James Britt</a> and <a href="https://neurogami.com">Neurogami</a>.</p><p><a href="https://jamesbritt.bandcamp.com/">Maximum R+D</a>.  </p>
</p>
  
  </footer>

<script type="text/javascript">


  let ads  = $("#carbonads-container").children().detach();


  function swapMode() {
    var cookieName = 'darkmode';
    var cssDarkmode = Cookies.get(cookieName);
    console.log("***** swapMode! " + cssDarkmode + " *****");


    if (cssDarkmode == "true") {
      console.log("We have dark mode, set the css to light ...");
      $('#rdoccss').attr("href", defaultModeCssHref);
      $('#cssSelect').text("Dark mode");
      cssDarkmode = "false";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    } else {
      console.log("We not have dark mode, set the css to dark ...");
      $('#rdoccss').attr("href", darkModeCsseHref);
      $('#cssSelect').text("Light mode");
      cssDarkmode = "true";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    }

    console.log("  --------------- ");
  }


const vueCssApp = new Vue({
el: '#menubar',
data: {
isDark: false
},
methods: {
toggleClass: function(event){
this.isDark = !this.isDark;
}
}
})

const vueApp = new Vue({
el: '#vapp',
data: { 
isOpen: true
},

mounted() {
this.handleResize();
this.manage_mob_classes();
window.addEventListener('resize', this.handleResize)
//this.isOpen !=  (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},
destroyed() {
window.removeEventListener('resize', this.handleResize)
},
created() {
//manage_mob_classes();
},

methods : {
isMobile() {
  return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},

  handleResize() {
    if (!this.isMobile()) {
      this.isOpen = window.innerWidth > 800;
    }
  },

  manage_mob_classes() {
    if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
      $("nav").addClass("mob_nav");
      $("main").addClass("mob_main");
      $("#extraz").addClass("mob_extraz");
      $("#carbonads-container").addClass("mob_carbonads-container");
      this.isOpen  = false;
    } else {
      $("nav").removeClass("mob_nav") 
        $("main").removeClass("mob_main");
      $("#extraz").removeClass("mob_extraz");
      $("#carbonads-container").removeClass("mob_carbonads-container");
      this.isOpen  = true;
    }
  },

  toggleNav() {
    this.isOpen =! this.isOpen ;
    // alert("Toggle nav!");
    console.log("toggleNav() click: " + this.isOpen );
  }
}
})

$("#carbonads-container").append(ads);


$(function() {

    var darkmode = Cookies.get("darkmode");
    console.log("Document ready: " + darkmode);

    if ( darkmode  == "true" ) {
      $('#cssSelect').text("Light mode");
    } else {
      $('#cssSelect').text("Dark mode");
     }

    $('body').css('display','block');
    });

</script>

    
  </body> 
</html>

